﻿<%@ Page Language="C#" MasterPageFile="~/Management.master" AutoEventWireup="true" CodeFile="equipmentView.aspx.cs" Inherits="equipmentView" Title="Untitled Page" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<%@ Register assembly="GridViewSortIndicatorSample" namespace="GuiHelpers" tagprefix="cc2" %>


<asp:Content ID="Content1" ContentPlaceHolderID="conSearch" Runat="Server">
   <div class="AccordionPanel">
        	    <div class="AccordionPanelTab"><b class="contentcolor">SEARCH</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </div>
        	    <div class="AccordionPanelContent">
        	      <div>Equipement Code:                       <asp:TextBox ID="txtCodeNumber" runat="server" Height="17px" 
                          Width="68px"></asp:TextBox>
                      <br /><br />
                                </div>
                    <div style="height:50px">
                        System: 
                                <asp:DropDownList ID="drlSystem" runat="server" Height="25px" 
                          Width="195px" AppendDataBoundItems="True" DataSourceID="odsSystem" 
                          DataTextField="SystemLabel" DataValueField="SystemId">
                                    <asp:ListItem Value="-1">--- Choose a system ---</asp:ListItem>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="odsSystem" runat="server" 
                          SelectMethod="GetSystems" TypeName="Service.ReferenceDataService">
                        </asp:ObjectDataSource>
                    </div>
                    <div style="height: 51px">
                        Type of equipement: 
                                <asp:DropDownList ID="drlEquipmentType" runat="server" Height="25px" 
                          Width="195px" AppendDataBoundItems="True" DataSourceID="odsEquipmentType" 
                          DataTextField="EquipmentTypeLabel" DataValueField="EquipmentTypeId" 
                          >
                                    <asp:ListItem Value="-1">--- Choose an equipment type ---</asp:ListItem>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="odsEquipmentType" runat="server" 
                          SelectMethod="GetEquipmentTypes" TypeName="Service.ReferenceDataService">
                        </asp:ObjectDataSource>
                    </div>
                    <div style="height: 50px; width: 219px;">
                        Company: 
                                <asp:DropDownList ID="drlCompany" runat="server" Height="25px" 
                          Width="195px" AppendDataBoundItems="True" DataSourceID="odsCompany" 
                          DataTextField="SupplierName" DataValueField="SupplierId">
                                    <asp:ListItem Value="-1">--- Choose a company ---</asp:ListItem>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="odsCompany" runat="server" 
                          SelectMethod="GetSuppliers" TypeName="Service.ReferenceDataService">
                        </asp:ObjectDataSource>
                    </div>
                    <div style="height: 50px">
                        Model:<asp:DropDownList ID="drlModel" runat="server" Height="25px" 
                          Width="195px" AppendDataBoundItems="True" DataSourceID="odsEquipmentModel" 
                          DataTextField="ModelLabel" DataValueField="ModelId">
                            <asp:ListItem Value="-1">--- Choose an equipment Model ---</asp:ListItem>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="odsEquipmentModel" runat="server" 
                          SelectMethod="GetModels" TypeName="Service.ReferenceDataService">
                        </asp:ObjectDataSource>
                                &nbsp; 
                    </div>
                    <div style="height: 50px">
                        Owner: 
                                <asp:DropDownList ID="drlUser" runat="server" Height="25px" 
                          Width="195px" AppendDataBoundItems="True" DataSourceID="odsEmployee" 
                          DataTextField="EmployeeName" DataValueField="EmployeeId">
                                    <asp:ListItem Value="-1">--- Choose an owner ---</asp:ListItem>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="odsEmployee" runat="server" 
                          SelectMethod="GetEmployees" TypeName="Service.ReferenceDataService">
                        </asp:ObjectDataSource>
                    </div>
               <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:Button  ID="btnSearch" 
                        runat="server" Height="25px" Text="Search" CssClass="btnexpress" 
        Width="71px" BorderStyle="Dotted" onclick="btnValidate_Click" />
            
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="m_contentBody" Runat="Server">

    
    <body onload="TabbedPanels1.showPanel<%=GetTabIndex() %>">
    <cc1:TabContainer ID="TabContainer1" runat="server" Height="400px" BorderColor="Red">
    <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="Equipment list ">
             <ContentTemplate>
               <table  class="GridItem" cellspacing="2" cellpadding="2" style="width:100%;height:350px">
    <tr>
        <td class="BigLabel" >
            <asp:Label Width="100%" Height="100%" ID="lblTotalEquipment" runat="server" Text="Label"></asp:Label>
            
        </td>
        </tr><tr>
        <td>
<div style=" height:350px; width:auto; overflow:auto">        
        <asp:GridView 
            ID="grdEquipment" 
            runat="server" 
            AllowPaging="True" 
            AutoGenerateColumns="False" 
            OnPageIndexChanging="grdEquipment_PageIndexChanging" 
            Width="96%" AllowSorting="True" 
            onrowcancelingedit="grdEquipment_RowCancelingEdit" 
            onrowdatabound="grdEquipment_RowDataBound1" 
            DataSourceID="odsEquipment" 
            RowHeaderColumn="EquipmentId" CssClass="GridItem" BorderStyle="None" 
            onselectedindexchanged="grdEquipment_SelectedIndexChanged" 
            DataKeyNames="EquipmentId"
            PageSize="20" >
            <SelectedRowStyle BackColor="#FF5050" />
                <HeaderStyle BorderStyle="None" CssClass="GridViewHeader" Height="30px" />
                    <Columns>
                        <asp:TemplateField>
                            <ItemTemplate>
            
                                <a href="EquipmentDisplay.aspx?detail=true&tabIndex=1&equipmentId=<%# DataBinder.Eval(Container.DataItem, "EquipmentId") %>&pageIndex=<%=GetPageIndex()%>""> 
                                    <img border=0 src="./images/b_view.png" width="20" height="20">
                                </a>  
                            </ItemTemplate>
                            
                            <ItemStyle Width="15px" Wrap="True" />
                        </asp:TemplateField>
                        
                        <asp:TemplateField>
                            <ItemTemplate>
                
                                <a href="EquipmentDisplay.aspx?detail=false&tabIndex=1&equipmentId=<%# DataBinder.Eval(Container.DataItem, "EquipmentId") %>&pageIndex=<%=GetPageIndex()%>""> 
                                    <img border=0 src="./images/edit.png" width="20" height="20">
                                </a> 
                            </ItemTemplate>
                            <ItemStyle Width="15px" />
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <a href="javascript:confirmDelete('EquipmentDisplay.aspx?delete=true&tabIndex=0&equipmentId=<%# DataBinder.Eval(Container.DataItem, "EquipmentId")%>&pageIndex=<%=GetPageIndex()%>')">
                                    <img border=0 src="./images/del.png" width="15" height="15" >
                                </a>
             
                            </ItemTemplate>
                            <ItemStyle Width="15px" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="EquipmentId" HeaderText="EquipmentId" 
                Visible="False">
                <ItemStyle Width="50px" />
            </asp:BoundField>
             <asp:TemplateField>
             <ItemTemplate>
            
            <a href="EquipmentAdd.aspx?pageIndex=<%=GetPageIndex()%>">
            <img border=0 src="./images/add.png" width="15" height="15">
            </a>
            </ItemTemplate>
                 <ItemStyle Width="15px" />
            </asp:TemplateField>
            <asp:BoundField DataField="CodeNumber" HeaderText="Code" SortExpression="CodeNumber">
                <ItemStyle Width="50px" />
            </asp:BoundField>
            <asp:BoundField HeaderText="System" DataField="System" SortExpression="System">
                <ItemStyle Width="60px" />
            </asp:BoundField>
            <asp:BoundField HeaderText="Type" DataField="TYPEEQUIPMENT" SortExpression="TYPEEQUIPMENT" >
                <ItemStyle Width="130px" />
            </asp:BoundField>
            <asp:BoundField DataField="Model" HeaderText="Model" SortExpression="Model" >
                <ItemStyle Width="130px" />
            </asp:BoundField>
            <asp:BoundField HeaderText="Purchase company" DataField="COMPANYNAME" 
                            SortExpression="COMPANYNAME">
                <ItemStyle Width="150px" />
            </asp:BoundField>
            <asp:BoundField HeaderText="Purchase date" DataField="PurchaseDate" 
                DataFormatString="{0:MM/dd/yyyy}" HtmlEncode="False" SortExpression="PurchaseDate">
                <ItemStyle Width="70px" />
            </asp:BoundField>
            <asp:BoundField HeaderText="Employee" DataField="EmployeeName" 
                            SortExpression="EmployeeName">
                <ItemStyle Width="130px" />
            </asp:BoundField>
            <asp:CheckBoxField DataField="DEMAGED" HeaderText="Damaged">
                <ItemStyle Width="15px" />
            </asp:CheckBoxField>
        </Columns>
        <PagerStyle HorizontalAlign="Center" 
            VerticalAlign="Middle" />
        <EditRowStyle BackColor="LightGray" />
        <RowStyle CssClass="AlternativeRowStyle" />
        <AlternatingRowStyle BackColor="White" CssClass="AlternativeRowStyle" />
    </asp:GridView>
</div>
        </td>
    </tr>
    <tr>
        <td align="center" class="GridItem" >
        <cc2:GridViewSortExtender ID="GridViewSortExtender1" runat="server" 
                    AscendingImageUrl="~/images/Ascending.gif" 
                    DescendingImageUrl="~/images/Descending.gif" ExtendeeID="grdEquipment">
                </cc2:GridViewSortExtender>
            <asp:UpdatePanel ID="updatePanelEquipment" runat="server">
            <ContentTemplate>
        
            
        
                <asp:ObjectDataSource ID="odsEquipment" runat="server" 
                    SelectMethod="GetEquipementDisplayed" TypeName="DirectService" 
                    >
                    <SelectParameters>
                        <asp:ControlParameter ControlID="txtHiddenWhereClause" Name="whereClause" 
                            PropertyName="Text" Type="String" />
                        <asp:Parameter Name="orderbyClause" Type="String" />
                    </SelectParameters>
                </asp:ObjectDataSource>
    <tr><td>
    <asp:TextBox ID="txtHiddenPageIndex" runat="server" Visible="False"></asp:TextBox>
    <a id="detailPosition"></a>
       <asp:TextBox ID="txtHiddenWhereClause" runat="server" Height="17px" Width="205px" Visible="False"></asp:TextBox>
       <asp:TextBox ID="txthiddenOrderbyClause" runat="server"  Width="77px" 
            Visible="False"></asp:TextBox>
              <Triggers>
                <asp:AsyncPostBackTrigger ControlID="txtHiddenWhereClause" EventName="TextChanged" />
                
            </Triggers>
            <Triggers>
            <asp:AsyncPostBackTrigger ControlID="txthiddenOrderbyClause" EventName="TextChanged" />
            </Triggers>
        	    </ContentTemplate>
        	    </asp:UpdatePanel>
     
                   
         </td></tr>
         
    </table>
    
            </ContentTemplate>
    </cc1:TabPanel>
   
        <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Search &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;">
          <ContentTemplate>
                <br />PAGE ONE -  Sample HTML Content for Tab
            </ContentTemplate>
        </cc1:TabPanel>
    </cc1:TabContainer>
    


       
    
    
</asp:Content>

